//package com.xdk.templatescala.config;
//
//import org.apache.ibatis.session.SqlSessionFactory;
//import org.mybatis.spring.SqlSessionFactoryBean;
//import org.mybatis.spring.annotation.MapperScan;
//import org.springframework.beans.factory.annotation.Qualifier;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.context.annotation.Primary;
//import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
//import org.springframework.jdbc.datasource.DataSourceTransactionManager;
//import org.springframework.transaction.PlatformTransactionManager;
//
//import javax.annotation.Resource;
//import javax.sql.DataSource;
//
//@Configuration
//@MapperScan(basePackages = "com.xdk.templatescala.mysqldao",sqlSessionFactoryRef = "LowcodeSqlSessionFactory")
//public class LowCodeDataSourceConfiguration {
//
//    @Resource(name = "lowCodeDataSource")
//    private DataSource dataSource;
//
//    @Bean
//    @Primary
//    public SqlSessionFactory LowcodeSqlSessionFactory() throws Exception{
//        SqlSessionFactoryBean factoryBean = new SqlSessionFactoryBean();
//        factoryBean.setDataSource(dataSource);
//        factoryBean.setMapperLocations(new PathMatchingResourcePatternResolver().getResources("classpath:mapper/*.xml"));
//        return factoryBean.getObject();
//    }
//
//    @Bean
//    @Primary
//    public PlatformTransactionManager firstTransactionManager(@Qualifier("lowCodeDataSource") DataSource dataSource) {
//        return new DataSourceTransactionManager(dataSource);
//    }
//}
